<template>
  <a-drawer
    title="详情"
    placement="right"
    width="80%"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :destroyOnClose="true"
    @close="handleCancel"
  >
    <div class="table-page-search-wrapper">
      <a-form layout="inline">
        <a-row :gutter="48">
          <!--          <a-col :md="8" :sm="24">-->
          <!--            <a-form-item label="设备SN号">-->
          <!--              <a-input placeholder="请输入设备SN号" v-model="queryParam.deviceSn" />-->
          <!--            </a-form-item>-->
          <!--          </a-col>-->
          <a-col :md="8" :sm="24">
            <a-button @click="() => {this.queryPage()}" type="primary">查询</a-button>
            <a-button @click="() =>{ queryParam = {}}" style="margin-left: 8px">重置</a-button>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <v-table
      :table-column="columns"
      :data="loadData"
      :rowKey="record => record.id"
      bordered
      ref="table"
    >
    </v-table>
  </a-drawer>

</template>

<script>
import { TableMixin } from '@/mixins/TableMixin'
import { dataList } from '@api/wfuSign/wfuSign'

export default {
  components: {},
  mixins: [TableMixin],
  name: 'details',
  data () {
    return {
      columns: [
        {
          title: '学生姓名',
          field: 'userName'
        },
        {
          title: '学号',
          field: 'userCode'
        },
        {
          title: '学院',
          field: 'institute'
        },
        {
          title: '专业班级',
          field: 'major'
        },
        {
          title: '学生电话',
          field: 'mobile'
        },
        {
          title: '导员姓名',
          field: 'assistantName'
        },
        {
          title: '导员工号',
          field: 'assistantCode'
        },
        {
          title: '导员电话',
          field: 'assistantMobile'
        },
        {
          title: '打卡时间',
          field: 'checkTime'
        },
        {
          title: '打卡地点',
          field: 'checkSpot'
        }
        /* {
          title: '操作',
          width: '80px',
          customRender: (text, record, index) => {
            return (
              <div>
                <a onClick={(e) => this.show(record)}
                >查看</a>
              </div>
            )
          }
        } */
      ],
      queryParam: {
        signType: undefined,
        timeScope: undefined
      },
      visible: false,
      confirmLoading: false,
      loadData: parameter => {
        return dataList(
          Object.assign(parameter, this.queryParam)
        ).then(res => {
          return res.data
        })
      }
    }
  },
  methods: {
    sign (signType, timeScope) {
      this.visible = true
      this.queryParam.signType = signType
      this.queryParam.timeScope = timeScope
    },
    handleCancel () {
      this.visible = false
    }
  }
}
</script>

<style scoped>

</style>
